package org.mch.func.db.field;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;

import org.mch.biz.ui.FuncEvent;
import org.mch.biz.ui.FuncPanel;
import org.mch.swingm.core.MListToList;

public class DBFieldPanel extends FuncPanel {
	private static final long serialVersionUID = 1L;
	private JScrollPane scrollPane_5;
	private JSplitPane splitPane;
	private JPanel panel_1;

	public DBFieldPanel() {
		setLayout(new BorderLayout(0, 0));
		add(getSplitPane_1(), BorderLayout.CENTER);
	}

	protected FuncEvent createEvent() {
		return new DBFieldEvent(this);
	}

	public JScrollPane getScrollPane_5() {
		if (scrollPane_5 == null) {
			scrollPane_5 = new JScrollPane();
			scrollPane_5.setBounds(10, 10, 284, 141);
		}
		return scrollPane_5;
	}

	public JSplitPane getSplitPane_1() {
		if (splitPane == null) {
			splitPane = new JSplitPane();
			splitPane.setRightComponent(getPanel_1_1());
			splitPane.setLeftComponent(getListToList());
			splitPane.setDividerLocation(600);
		}
		return splitPane;
	}

	public JPanel getPanel_1_1() {
		if (panel_1 == null) {
			panel_1 = new JPanel();
			panel_1.setLayout(null);
			panel_1.add(getText_oldfield());
			panel_1.add(getLblNewLabel_1());
			panel_1.add(getText_newfield());
			panel_1.add(getBtnExecute());
			panel_1.add(getChckbx_modifyfield());
			panel_1.add(getBtn_loadtable());
			panel_1.add(getChckbxNewCheckBox());
			panel_1.add(getText_addfield());
			panel_1.add(getLabel());
			panel_1.add(getText_fieldtype());
		}
		return panel_1;
	}

	private MListToList<String> listToList;
	private JTextField text_oldfield;
	private JLabel lblNewLabel_1;
	private JTextField text_newfield;
	private JButton btnExecute;
	private JCheckBox chckbx_modifyfield;
	private JButton btn_loadtable;
	private JCheckBox chckbxNewCheckBox;
	private JTextField text_addfield;
	private JLabel label;
	private JTextField text_fieldtype;

	public MListToList<String> getListToList() {
		if (listToList == null) {
			listToList = new MListToList<String>();
			listToList.getLstRight().setBorder(
					new TitledBorder(null, "\u5DF2\u9009\u8868\uFF1A", TitledBorder.LEADING, TitledBorder.TOP, null, null));
			listToList.getLstLeft().setBorder(
					new TitledBorder(null, "\u5F85\u9009\u8868\uFF1A", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		}
		return listToList;
	}

	public JTextField getText_oldfield() {
		if (text_oldfield == null) {
			text_oldfield = new JTextField();
			text_oldfield.setBounds(182, 131, 66, 21);
			text_oldfield.setColumns(10);
		}
		return text_oldfield;
	}

	public JLabel getLblNewLabel_1() {
		if (lblNewLabel_1 == null) {
			lblNewLabel_1 = new JLabel("\u6539\u540D\u4E3A\uFF1A");
			lblNewLabel_1.setBounds(258, 130, 71, 22);
		}
		return lblNewLabel_1;
	}

	public JTextField getText_newfield() {
		if (text_newfield == null) {
			text_newfield = new JTextField();
			text_newfield.setBounds(327, 131, 66, 21);
			text_newfield.setColumns(10);
		}
		return text_newfield;
	}

	public JButton getBtnExecute() {
		if (btnExecute == null) {
			btnExecute = new JButton("\u6267\u884C");
			btnExecute.setBounds(10, 261, 93, 23);
			btnExecute.addActionListener(getEvent());
		}
		return btnExecute;
	}

	public JCheckBox getChckbx_modifyfield() {
		if (chckbx_modifyfield == null) {
			chckbx_modifyfield = new JCheckBox("\u5C06\u9009\u62E9\u7684\u8868\u7684\u5B57\u6BB5\uFF1A");
			chckbx_modifyfield.setBounds(10, 131, 166, 23);
		}
		return chckbx_modifyfield;
	}

	public JButton getBtn_loadtable() {
		if (btn_loadtable == null) {
			btn_loadtable = new JButton("\u52A0\u8F7D");
			btn_loadtable.setToolTipText("\u52A0\u8F7D\u6570\u636E\u5E93\u8868");
			btn_loadtable.setBounds(10, 10, 93, 23);
			btn_loadtable.addActionListener(getEvent());
		}
		return btn_loadtable;
	}

	public JCheckBox getChckbxNewCheckBox() {
		if (chckbxNewCheckBox == null) {
			chckbxNewCheckBox = new JCheckBox("\u4E3A\u9009\u62E9\u7684\u8868\u589E\u52A0\u5B57\u6BB5\uFF1A");
			chckbxNewCheckBox.setBounds(10, 90, 166, 23);
		}
		return chckbxNewCheckBox;
	}

	public JTextField getText_addfield() {
		if (text_addfield == null) {
			text_addfield = new JTextField();
			text_addfield.setBounds(182, 90, 66, 21);
			text_addfield.setColumns(10);
		}
		return text_addfield;
	}

	public JLabel getLabel() {
		if (label == null) {
			label = new JLabel("\u7C7B\u578B\u4E3A\uFF1A");
			label.setBounds(258, 93, 65, 15);
		}
		return label;
	}

	public JTextField getText_fieldtype() {
		if (text_fieldtype == null) {
			text_fieldtype = new JTextField();
			text_fieldtype
					.setToolTipText("\u8BF7\u586B\u5199\u5B8C\u6574\u7C7B\u578B\uFF01\u5982\uFF1Achar(1)\u3001varchar(10)\u3001decimal(10,2) \u7B49\uFF01");
			text_fieldtype.setBounds(327, 90, 66, 21);
			text_fieldtype.setColumns(10);
		}
		return text_fieldtype;
	}
}